---
import "../styles/global.css";
const allPosts = await Astro.glob('../pages/posts/*.md');
import BaseLayout from "../layouts/BaseLayout.astro";
import BlogPost from "../components/BlogPost.astro";
const pageTitle = "博客";
---

<BaseLayout pageTitle={pageTitle}>
    <h1>我的 Astro 学习博客</h1>
    <p>在这里，我将分享我的学习 Astro 之旅。</p>
    <ul>
        <!-- {allPosts.map(post =><li><a href={post.url}>{post.frontmatter.title}</a></li>)} -->
      {allPosts.map(post => <BlogPost url={post.url} title={post.frontmatter.title} />)}
    </ul>
</BaseLayout>
